<?php
/**
 * Created by PhpStorm.
 * User: zhang
 * Date: 2015/11/17
 * Time: 9:57
 * 用于保存相对固定的数据，方便扩展
 */
class Datas {
    //公寓
    protected $alonesList=array(
        '7'=>array('7.4','7.11','7.8','8.4','8.5','8.12','8.15','9.6','12.3','9.15','10.9','11.1','11.6','11.7','11.16','12.7','12.12','6.7'),
        '6'=>array('7.2','7.12','7.10','8.3','8.7','8.14','9.2','9.4','12.5','10.3','10.10','10.14','11.3','11.11','11.13','12.9','12.13','6.9'),
        '5'=>array('7.3','7.13','7.6','8.2','8.8','8.13','9.1','9.5','12.4','9.16','10.8','10.15','11.4','11.10','11.14','12.10','12.15','6.4'),
        '4'=>array('7.5','7.14','7.7','7.16','8.6','8.10','8.16','9.8','12.1','10.4','10.12','10.16','11.2','11.8','11.12','12.6','12.11','6.8'),
        '3'=>array('7.1','7.15','7.9','8.1','8.9','8.11','9.3','9.7','12.2','10.6','10.11','10.13','11.5','11.9','11.15','12.8','12.14','6.6'),
        '2'=>array('10.7','10.1','5.2','3.2','5.1','9.14','3.4','3.6','5.10','6.14','6.12','5.8','5.12','3.9','3.8','6.13','6.15','5.16'),
        '1'=>array('10.5','10.2','3.1','5.11','5.6','5.3','6.11','5.13','5.9','3.3','6.16','5.7','5.4','3.5','5.5','3.7','5.15','5.14'),
    );
    //写字楼
    protected $officesList=array(
        '3.14','3.12','2.14','3.15','3.10','2.1','3.11','2.11','2.2','2.7','2.15','2.13','2.4','2.10','2.3','3.16','3.13','2.6','2.5','2.12'
    );
    //会所
    protected $clubsList=array(
        '6.1'
    );
    //避难层
    protected $asylumsList=array(
        '2.9','2.8','2.16'
    );
    //环境光
    protected $surroundingsList=array(
        '6.1'
    );
    //返回上面的数据
    static public function to($type){
        $object=new ReturnData();
        return $object->ReturnArray($type);
    }
}
class ReturnData extends Datas{
    public function ReturnArray($type){
        if($type=='alls'){
            $key=array_keys(get_object_vars(new Datas()));
            $allArray=array();
            foreach($key as $kk=>$kv){
                foreach($this->$kv as $tk=>$tv){
                    if(is_array($tv)){
                        foreach($tv as $k=>$v){
                            $allArray[]=$v;
                        }
                        continue;
                    }
                    $allArray[]=$tv;
                }
            }
            return $allArray;
        }
        return $this->$type;
    }
}
?>